<template>
  <div>
    <div style="display: flex;justify-content: space-around;">
      <el-row>
        <el-col>
          <div>
            <el-form-item label="客户名称">
              {{ clientName }}
            </el-form-item>
            <el-form-item label="销售员">
              {{ whoCheckOut }}
            </el-form-item>
            <el-form-item label="销售日期">
              {{ endSaleDate }}
            </el-form-item>
            <el-form-item label="订单金额">
              {{ orderPrice }}
            </el-form-item>
            <el-form-item label="送货地址">
              {{ addressWhere }}
            </el-form-item>
          </div>
          <div class="grid-content bg-purple-dark">
            <el-table
                :data="tableData"
                style="width: 100%">
              <el-table-column
                  label="商品名称"
                  prop="productBean.productName"
                  width="160">
              </el-table-column>
              <el-table-column
                  label="厂家"
                  prop="productBean.factory"
                  width="160">
              </el-table-column>
              <el-table-column
                  label="成交价格"
                  prop="endSalePrice"
                  width="160">
              </el-table-column>
              <el-table-column
                  label="出库数量"
                  prop="checkOutNum"
                  width="160">
              </el-table-column>
            </el-table>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  name: "CInfoDetail",
  data() {
    return {
      tableData: [],
      clientName: '',
      whoCheckOut: '',
      endSaleDate: '',
      orderPrice: '',
      addressWhere: ''
    }
  }, methods: {
    showCheckByDetail(id) {
      console.log(id)
      let url = "api/check/findCheckById/" + id
      this.axios.get(url).then(r => {
        console.log(r)
        this.tableData = r.data.checkInfoList
        this.clientName = r.data.clientBean.clientName
        this.whoCheckOut = r.data.userBean.username
        this.endSaleDate = r.data.saleDate
        this.addressWhere = r.data.address
        this.orderPrice = r.data.allPrice
      })
    }
  }
}
</script>

<style scoped>

</style>